<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>用户信息管理</title>

    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">

    <script type="text/javascript" src="/js/xadmin.js"></script>
<!--    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>-->
<!--    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>-->
    <script src="layui/layui.all.js"></script>
<style type="text/css">
    td, th {
        text-align: center;
    }
</style>
</head>
<body>
<div class="layui-container">
    <h3 style="text-align: center">信息表</h3>
    <table class="layui-table" id="demo" lay-filter="test">
        <tr class="success" >
            <th style="text-align: center">用户名</th>
            <th style="text-align: center">姓名</th>
            <th style="text-align: center">性别</th>
            <th style="text-align: center">身份号</th>
            <th style="text-align: center">电话</th>
            <th style="text-align: center">Email</th>
            <th style="text-align: center">操作</th>
        </tr>
        <tr>
            <td><span th:text="${session.username}"></span></td>
            <td><span th:text="${customer.getCustName()}"></span></td>
            <td><span th:text="${customer.getSex()}"></span></td>
            <td><span th:text="${customer.getCustNum()}"></span></td>
            <td><span th:text="${customer.getCustPhone()}"></span></td>
            <td><span th:text="${session.user.getEmail()}"></span></td>
            <td><a id="edit" class="layui-btn layui-btn-xs" >修改</a></td>
        </tr>
    </table>
</div>
</body>
</html>
<script src="/js/jquery-2.1.0.min.js" charset="utf-8"></script>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    var form = layui.form;
    layui.use('form', function() {
        $("#edit").click(function () {
            parent.layer.open({
                type: 2,
                area: ['500px', '400px'],
                title: '修改信息',
                content: '/toUser-updateCust',
                btn: ['提交', '返回']
                ,yes: function(index, layero){
                    // var body = layer.getChildFrame('body', index);
                    // body.find('form button:eq(0)').click();
                    var submit = layero.find('iframe').contents().find("#subBtn");// #subBtn为页面层提交按钮ID
                    submit.click();// 触发提交监听
                    var index = parent.layer.getFrameIndex(window.name);//获取窗口索引
                    parent.layer.close(layero);//关闭弹出层
                },
                btn2: function(index, layero){
                    layer.close(index);

                },
                cancel: function(layero,index){
                    layer.closeAll();
                },
                end: function () {
                    location.reload();
                },
            });
            return false;
        });
        return false;
    });
</script>

